package com.xiaolin.designmode.builder;

/**
 * @ClassName Director
 * @Description 指挥者
 * @Detail 负责调用构建者生产产品各个部件，并将完整的产品返回
 * @Author MyPC
 * @Date 2020/10/30
 * @Version 1.0
 */
public class Director {
    private AbstractMotorBuilder abstractMotorBuilder;
    public Director(AbstractMotorBuilder abstractMotorBuilder){
        this.abstractMotorBuilder=abstractMotorBuilder;
    }
    public Motorbike build(){
        abstractMotorBuilder.setFrame();
        abstractMotorBuilder.setEngine();
        abstractMotorBuilder.setTire();
        return abstractMotorBuilder.getMotorbike();
    }
}
